﻿@model  PaggingResultModel<UserInfo, UserSearchModel>
<!-- Box -->
<div class="box">
    <!-- Box Head -->
    <div class="box-head">
        <h2 class="left">
            现有用户</h2>
    </div>
    <!-- End Box Head -->
    <!-- Table -->
    <div class="table">
        @if (Model.TotalPageCount != 0)
        {
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <th width="13">
                        <input type="checkbox" class="checkbox" />
                    </th>
                    <th>
                        用户名
                    </th>
                    <th>
                        姓名
                    </th>
                    <th>
                        状态
                    </th>
                    <th>
                        建立时间
                    </th>
                    <th width="110" class="ac">
                        删除/编辑
                    </th>
                </tr>
                @{ var odd = true; }
                @foreach (var user in Model.ResultList)
                {
                      <tr class="@(odd ? "odd" : "")">
                        <td>
                            <input type="checkbox" class="checkbox" name="item" />
                        </td>
                        <td>
                            <h3>
                                <a href="#"></a>@user.Username</h3>
                        </td>
                        <td>
                            @user.FamilyName
                        </td>
                        <td>
                            @user.Status
                        </td>
                        <td>
                            @user.CreateTime
                        </td>
                        <td>
                            <a href="@Url.Action("UserDelete", "User", new { ID = @user.ID })" class="ico del">删除</a>
                            <a href="@Url.Action("UserDetail", "User", new { ID = @user.ID })" class="ico edit">编辑</a>
                        </td>
                    </tr>
                    odd = !odd;
                }
            </table>
        }
        else
        { 
            <div class="empty">
                没有记录</div>
        }
        <!-- Pagging -->
        <div class="pagging">
            @Html.BuildViewCount(Model)
            @Html.BuildPaggingFooter(Model, "User", "Index")
        </div>
        <!-- End Pagging -->
    </div>
    <!-- Table -->
</div>
<!-- End Box -->
<!-- Sidebar -->
@section SideBar {
    <!-- Box -->
    <div class="box">
        <!-- Box Head -->
        <div class="box-head">
            <h2>
                用户权限管理</h2>
        </div>
        <!-- End Box Head-->
        <div class="box-content">
            <a href="@Url.Action("UserCreate", "User")" class="add-button"><span>
                添加新用户</span></a>
            <div class="cl">
                &nbsp;</div>
            <a href="@Url.Action("UserRoleList")" class="add-button"><span>用户组管理</span></a>
            <div class="cl">
                &nbsp;</div>
            <!-- inqury -->
            <div class="sort">
                @{Html.BeginForm("Index", "User", FormMethod.Get, new { id = "searchForm" });}
                <table class="tableForForm">
                    <tr>
                        <td colspan="2">
                            <h4>
                                查找条件</h4>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            用户名：
                        </td>
                        <td>
                            @Html.TextBox("Username", null, new { @class = "field size3" })
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            姓名：
                        </td>
                        <td>
                            @Html.TextBox("FamilyName", null, new { @class = "field size3" })
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="right">
                            <a href="#" class="submit-button" onclick="$('#searchForm').submit();"><span>查询</span></a>
                        </td>
                    </tr>
                </table>
                @{Html.EndForm();}
            </div>
            <!-- End inqury -->
        </div>
    </div>
    <!-- End Box -->
}
